//-----------------------------------------------------------------------
// <copyright file="a_Surveys_OptionService.cs" company="AACECOM">
//     Copyright (c) AACECOM. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections;
using ThoiTrang.Entities;
using ThoiTrang.Data;
    
namespace ThoiTrang.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class a_Surveys_OptionService
    {
        #region a_Surveys_Option

        public static void Createa_Surveys_Option(a_Surveys_Option a_Surveys_Option)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                a_Surveys_OptionDAO.Createa_Surveys_Option(a_Surveys_Option);
            }            
            catch (Exception ex)
            {                
                throw ex;
            }
        }        

        public static void Updatea_Surveys_Option(a_Surveys_Option a_Surveys_Option)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                a_Surveys_OptionDAO.Updatea_Surveys_Option(a_Surveys_Option);
            }           
            catch (Exception ex)
            {
                throw ex;
            }
        }        

        public static void Deletea_Surveys_Option(int id)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                a_Surveys_OptionDAO.Deletea_Surveys_Option(id);
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }
        
        public static a_Surveys_Option Geta_Surveys_Option(int id)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_Option(id);                
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }                

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList(a_Surveys_OptionColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList(orderBy, orderDirection);
            }            
            catch (Exception ex)
            {
               throw ex;
            }
        }        

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList_alphabet(int qid, string mychar, a_Surveys_OptionColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList_alphabet(qid, mychar, orderBy, orderDirection, page, pageSize, out totalRecords);
            }            
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList_alphabet(int qid, string mychar, a_Surveys_OptionColumns orderBy, OrderDirection orderDirection)
        {
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList_alphabet(qid, mychar, orderBy, orderDirection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList(a_Surveys_OptionColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList_qid(int qid, a_Surveys_OptionColumns orderBy, OrderDirection orderDirection)
        {
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList_qid(qid, orderBy, orderDirection);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList_qid(int qid, a_Surveys_OptionColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList_qid(qid, orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }  

        #endregion

        public static a_Surveys_OptionCollection Geta_Surveys_OptionList(out string question, out int qid)
        {
            try
            {
                a_Surveys_OptionDAO a_Surveys_OptionDAO = new a_Surveys_OptionDAO();
                return a_Surveys_OptionDAO.Geta_Surveys_OptionList(out question, out qid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static void a_Surveys_Option_IncreaseOption(int optID)
        {
            try
            {
                a_Surveys_Option option = a_Surveys_OptionService.Geta_Surveys_Option(optID);
                option.RespCount += 1;
                a_Surveys_OptionService.Updatea_Surveys_Option(option);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}